| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { Entity, PrimaryGeneratedColumn, ManyToOne } from 'typeorm'; |
||
| 4 | |||
| 5 | @Entity() |
||
| 6 | export class SchoolUser { |
||
| 7 | @PrimaryGeneratedColumn('uuid') |
||
| 8 | private id: string; |
||
| 9 | |||
| 10 | @ManyToOne(() => School, { nullable: false, onDelete: 'CASCADE' }) |
||
| 11 | private school: School; |
||
| 12 | |||
| 13 | @ManyToOne(() => User, { nullable: false, onDelete: 'CASCADE' }) |
||
| 14 | private user: User; |
||
| 15 | |||
| 16 | constructor(school: School, user: User) { |
||
| 17 | this.school = school; |
||
| 18 | this.user = user; |
||
| 19 | } |
||
| 20 | |||
| 21 | public getId(): string { |
||
| 22 | return this.id; |
||
| 23 | } |
||
| 24 | |||
| 25 | public getSchool(): School { |
||
| 26 | return this.school; |
||
| 27 | } |
||
| 28 | |||
| 29 | public getUser(): User { |
||
| 30 | return this.user; |
||
| 31 | } |
||
| 33 |